package m.html.element;

import m.html.element.attr.Size;
import m.html.element.other.InputElement;

public class DatePicker extends InputElement {

	public DatePicker(String field) {
		this(field,false);
	}
	public DatePicker(String field,boolean showTime) {
		super("a-date-picker");
		super.setField(field);
		super.setSize(Size.DEFAULT);
		super.setDisabled("false");
		super.setPlaceholder("");
		if(showTime) {
			super.A("showTime");
		}
		super.A("format",showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD");
		super.A("valueFormat",showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD");
		viewElement=Element.tag("div").A("class","input-view-box").E("{{formatter('',"+field+",'"+(showTime?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd")+"')}}");
	}
}
